﻿@{
var pagination = @Page[0];
//pagination.page=5;
//pagination.setMaxSize(100);
pagination.boundaryLinks=true;
}
<ul class="pagination">
    @if(pagination.boundaryLinks&&pagination.page>1){
        var link=pagination.baseLink.Replace("{page}","1");
        <li><a href="@link">first</a></li>
    }
    @if(pagination.directionLinks&&pagination.page>1){
    var link=pagination.baseLink.Replace("{page}",(pagination.page-1).ToString());
    <li class="prev"><a href="@link">left</a></li>
    }
    @for(int i=pagination.start;i <= pagination.end ;i++){
        var link=pagination.baseLink.Replace("{page}",i.ToString());
        if(pagination.page==i){
            <li class="active"><a href="javascript:;">@i</a></li>
        }else{
            <li><a href="@link">@i</a></li>
        }
    }
    
    @if(pagination.directionLinks&&pagination.page < pagination.maxSize){
    var link=pagination.baseLink.Replace("{page}",(pagination.page+1).ToString());
    <li class="next"><a href="@link">right</a></li>
    }
    @if(pagination.boundaryLinks&&pagination.page < pagination.maxSize){
    var link=pagination.baseLink.Replace("{page}",pagination.maxSize.ToString());
    <li><a href="@link">end</a></li>
    }
</ul>

